package com.yjweb.webportal.controller;

import com.yjweb.webportal.entities.Contacts;
import com.yjweb.webportal.service.ContactsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
@Controller
public class ContactsController {
    @Autowired
    private ContactsService contactsService;
    @GetMapping("/contacts")
    public String list(Model model) {
        //获取优先级最高一条
        Contacts contacts =contactsService.getAllContactsInfo();
        model.addAttribute("contacts",contacts);
        return "contacts/contacts";
    }
}
